import tkinter as tk
from tkinter import messagebox
login_window = tk.Tk()
screenwidth = login_window.winfo_screenwidth()
screenheight = login_window.winfo_screenheight()
login_window.title('灵璧二中学生登录系统')
login_window.geometry(f'420x150+{int(screenwidth/2-210)}+{int(screenheight/2-175)}')
username_label = tk.Label(login_window, text="用户名：",width=10).place(x=100, y=27) # 用户名标签
username= tk.StringVar()
username_input = tk.Entry(login_window,textvariable=username) # 用户名输入
username_input.place(x=160, y=30)
password_label = tk.Label(login_window, text="密码：").place(x=123, y=57) # 密码标签
password= tk.StringVar()
password_input = tk.Entry(login_window, show='*',textvariable = password)# 密码输入
password_input.place(x=160, y=60)
"""获取用户输入"""
def get_input():
    return username.get(),password.get()
def reset_handle():
    username.set("")
    password.set("")
tk.Button(login_window, text='重置', width=7, height=1, command=reset_handle).place(x=230, y=90)
def login_button(handle):
    tk.Button(login_window, text='登录', width=7, height=1, command=handle).place(x=130, y=90)
    login_window.mainloop()
